1. Field of the Invention
The present invention relates to an information processing technique for processing XML documents and, more particularly, to an information processing technique used upon processing an XML document as tree structure data.
2. Description of the Related Art
As standard APIs of an XML parser, SAX and DOM are generally known (details of SAX and DOM are described at sites designated by, for example, “URL:http://www.saxproject.org/” and “URL:http://www.w3.org/DOM/”).
SAX sequentially reads an XML document from the beginning, and transfers information to an application program via an event which is generated in the process of reading. That is, the SAX sequentially transfers information in turn from findings during parsing of the XML document, and starts processing before completion of parsing. For this reason, the SAX can speed up the processing of XML documents.
On the other hand, DOM handles an XML document as tree structure data (DOM tree). For this reason, the DOM can access data in the XML document only after an XML parser has read the whole XML document. Hence, the processing speed of the DOM is lower than the SAX. Then again, the DOM can access irrespective of the order of data in the XML document.
A schema often defines a type of an attribute which is converted into tree structure data as a DOM tree (for example, “5” of x=“5” is that of an integer, etc.). As a characteristic feature of the DOM tree, even when the schema defines the type of the attribute (x) to be other than a character string, the attribute value (“5”) is held as a character string.
Also, attribute values before and after a change of events (DOM Events) which are generated in response to a change in attribute value of the DOM tree are held as character strings irrespective of the schema's definition.
However, in general, when an application executes processing using a DOM tree generated based on an XML document, attribute values are often used after they are converted into types of the schema (for example, an attribute value of an x attribute that represents an x-coordinate is processed after it is converted into an integer or floating point number).
For this reason, when an event upon changing an attribute value is generated, an event handler that processes the event must execute processing for converting a changed attribute value held by the event from a character string to a type designated by the schema. In case of the DOM, requirement of such conversion processing also disturbs speeding up of the processing.
On the other hand, there is a special DOM which is assumed to have an attribute value as a type designated by the schema from the beginning in place of a character string, like SVG Micro DOM (http://www.w3.org/TR/SVGMobile12/svgudom.html).
However, even when such a special DOM is used, if a standardized event is used as an event that is generated upon changing an attribute value, similar conversion processing is required. More specifically, redundant processing is required: a type designated by the schema is converted into a character string, which is set in an event, and the event handler converts that character string into the type designated by the schema.